package c.e.a.b.f.b;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class j3<V> {
    public static final Object g = new Object();
    public final String a;
    public final h3<V> b;
    public final V c;
    public final V d;
    public final Object e = new Object();
    public volatile V f = null;

    public j3(String str, Object obj, Object obj2, h3 h3Var, f3 f3Var) {
        this.a = str;
        this.c = obj;
        this.d = obj2;
        this.b = h3Var;
    }

    /* JADX WARNING: Missing exception handler attribute for start block: B:32:0x0044 */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x0045 A:{SYNTHETIC} */
    /* JADX WARNING: Removed duplicated region for block: B:49:0x005c A:{SYNTHETIC, Splitter:B:49:0x005c} */
    /* JADX WARNING: Removed duplicated region for block: B:47:0x0059  */
    /* JADX WARNING: Can't wrap try/catch for region: R(7:27|28|29|(1:31)|32|44|37) */
    /* JADX WARNING: Missing block: B:19:0x0021, code skipped:
            return r5;
     */
    /* JADX WARNING: Missing block: B:22:?, code skipped:
            r5 = c.e.a.b.f.b.p.a.iterator();
     */
    /* JADX WARNING: Missing block: B:35:?, code skipped:
            r1.f = r2;
     */
    public final V a(V r5) {
        /*
        r4 = this;
        r0 = g;
        r1 = r4.e;
        monitor-enter(r1);
        monitor-exit(r1);	 Catch:{ all -> 0x006a }
        if (r5 == 0) goto L_0x0009;
    L_0x0008:
        return r5;
    L_0x0009:
        r5 = c.e.a.b.b.j.d.f;
        if (r5 != 0) goto L_0x0010;
    L_0x000d:
        r5 = r4.c;
        return r5;
    L_0x0010:
        monitor-enter(r0);
        r5 = c.e.a.b.f.b.ga.a();	 Catch:{ all -> 0x0067 }
        if (r5 == 0) goto L_0x0022;
    L_0x0017:
        r5 = r4.f;	 Catch:{ all -> 0x0067 }
        if (r5 != 0) goto L_0x001e;
    L_0x001b:
        r5 = r4.c;	 Catch:{ all -> 0x0067 }
        goto L_0x0020;
    L_0x001e:
        r5 = r4.f;	 Catch:{ all -> 0x0067 }
    L_0x0020:
        monitor-exit(r0);	 Catch:{ all -> 0x0067 }
        return r5;
    L_0x0022:
        monitor-exit(r0);	 Catch:{ all -> 0x0067 }
        r5 = c.e.a.b.f.b.p.a;	 Catch:{ SecurityException -> 0x0054 }
        r5 = r5.iterator();	 Catch:{ SecurityException -> 0x0054 }
    L_0x0029:
        r1 = r5.hasNext();	 Catch:{ SecurityException -> 0x0054 }
        if (r1 == 0) goto L_0x0055;
    L_0x002f:
        r1 = r5.next();	 Catch:{ SecurityException -> 0x0054 }
        r1 = (c.e.a.b.f.b.j3) r1;	 Catch:{ SecurityException -> 0x0054 }
        r2 = c.e.a.b.f.b.ga.a();	 Catch:{ SecurityException -> 0x0054 }
        if (r2 != 0) goto L_0x004c;
    L_0x003b:
        r2 = 0;
        r3 = r1.b;	 Catch:{ IllegalStateException -> 0x0044 }
        if (r3 == 0) goto L_0x0044;
    L_0x0040:
        r2 = r3.q();	 Catch:{ IllegalStateException -> 0x0044 }
    L_0x0044:
        monitor-enter(r0);	 Catch:{ SecurityException -> 0x0054 }
        r1.f = r2;	 Catch:{ all -> 0x0049 }
        monitor-exit(r0);	 Catch:{ all -> 0x0049 }
        goto L_0x0029;
    L_0x0049:
        r5 = move-exception;
        monitor-exit(r0);	 Catch:{ all -> 0x0049 }
        throw r5;	 Catch:{ SecurityException -> 0x0054 }
    L_0x004c:
        r5 = new java.lang.IllegalStateException;	 Catch:{ SecurityException -> 0x0054 }
        r0 = "Refreshing flag cache must be done on a worker thread.";
        r5.<init>(r0);	 Catch:{ SecurityException -> 0x0054 }
        throw r5;	 Catch:{ SecurityException -> 0x0054 }
    L_0x0055:
        r5 = r4.b;
        if (r5 != 0) goto L_0x005c;
    L_0x0059:
        r5 = r4.c;
        return r5;
    L_0x005c:
        r5 = r5.q();	 Catch:{ SecurityException -> 0x0064, IllegalStateException -> 0x0061 }
        return r5;
    L_0x0061:
        r5 = r4.c;
        return r5;
    L_0x0064:
        r5 = r4.c;
        return r5;
    L_0x0067:
        r5 = move-exception;
        monitor-exit(r0);	 Catch:{ all -> 0x0067 }
        throw r5;
    L_0x006a:
        r5 = move-exception;
        monitor-exit(r1);	 Catch:{ all -> 0x006a }
        throw r5;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.b.f.b.j3.a(java.lang.Object):java.lang.Object");
    }
}
